import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
  mode: 'history',
  routes: [
    {
      path: '/index',
      name: 'Index',
      component: () => import('@/views/Index'),

    },{
      path: '/',
      redirect:'/index',
    },{
      path: '/course',
      name: 'Course',
      component: ()=>import('@/views/Course')
    },{
      path: '/dynamic',
      name: 'Dynamic',
      component: ()=>import('@/views/Dynamic')
    },{
      path: '/login',
      name:'Login',
      component: ()=>import('@/views/Login')
    },{
      path: '/news',
      name:'News',
      component: ()=>import('@/views/News')
    },{
      path: '/register',
      name: 'Register',
      component: ()=>import('@/views/Register')
    },{
      path: '/school',
      name: 'School',
      component: ()=>import('@/views/School')
    },{
      path: '/toAdmin',
      name: 'Alogin',
      component: ()=>import('@/views/admin/Login')
    },{
      path: '/admin',
      name: 'Admin',
      component: ()=>import('@/views/admin/Admin'),
      children:[
        {
          path: '/cou',
          name: 'Acourse',
          component: ()=>import('@/views/admin/CourseAdmin')
        },{
          path: '/dy',
          name: 'Adynamic',
          component: ()=>import('@/views/admin/DynamicAdmin')
        },{
          path: '/ne',
          name: 'Anews',
          component: ()=>import('@/views/admin/NewsAdmin')
        },{
          path: '/sc',
          name: 'Aschool',
          component: ()=>import('@/views/admin/SchoolAdmin')
        },{
          path: '/user',
          name: 'User',
          component: ()=>import('@/views/admin/User')
        },{
          path: '/role',
          name: 'Role',
          component: ()=>import('@/views/admin/Role')
        }
        ]
    }
  ]
})
